﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace VMC.Domain.Service.Abstract
{
    public interface IService<T>: IDisposable where T : class
    {
       
        IEnumerable<T> All();
        
        T Find(int ID);

        T Create(T EntityInstance, out bool status);

        T Update(T t, out bool status);

        bool Delete(int ID);

        bool Validate(T EntityInstance);

        Dictionary<string, string> GetValidationErrors();

        bool Contains(Expression<Func<T, bool>> predicate);


        IEnumerable<T> Search(Expression<Func<T, bool>> predicate);

        IEnumerable<T> Search(Expression<Func<T, bool>> filter, out int total, int index = 0, int size = 50);

    }
}
